From 9603f422cac3bea7044c2dfe969c215ec9897dfa Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Wed, 24 Apr 2024 22:17:07 -0700
Subject: fix(badges): awc badge tooltip

---
 src/routes/user/[user]/badges/+page.svelte | 34 ++++++++++++------------------
 1 file changed, 13 insertions(+), 21 deletions(-)

(limited to 'src/routes/user/[user]/badges/+page.svelte')

diff --git a/src/routes/user/[user]/badges/+page.svelte b/src/routes/user/[user]/badges/+page.svelte
index 5a616017..caf2019d 100644
--- a/src/routes/user/[user]/badges/+page.svelte
+++ b/src/routes/user/[user]/badges/+page.svelte
@@ -29,6 +29,7 @@
 	import { thumbnail } from '$lib/Utility/image.js';
 	import authorisedJson from '$lib/Data/Static/authorised.json';
 	import identity from '$stores/identity';
+	import type { AWCBadgesGroup } from '$lib/Data/AWC.js';
 
 	export let data;
 
@@ -68,19 +69,6 @@
 
 	type GroupedBadges = { [key: string]: IndexedBadge[] };
 
-	interface AWCBadge {
-		link: string;
-		description: string;
-		image: string;
-		source: string;
-		designer: string;
-	}
-
-	interface AWCBadgesGroup {
-		group: string;
-		badges: AWCBadge[];
-	}
-
 	interface IndexedBadge extends Badge {
 		index: number;
 	}
@@ -547,14 +535,18 @@
 											<p />
 
 											<div class="badges">
-												{#each group.badges as badge}
-													<FallbackBadge
-														{badge}
-														source={cdn(thumbnail(badge.image))}
-														alternative={badge.description}
-														fallback={thumbnail(badge.image)}
-														hideOnError={preferences.hide_missing_badges}
-													/>
+												{#each group.badges as badge, index}
+													<div id={`badge-${index}`}>
+														<FallbackBadge
+															{badge}
+															source={cdn(thumbnail(badge.image))}
+															alternative={badge.description}
+															fallback={thumbnail(badge.image)}
+															hideOnError={preferences.hide_missing_badges}
+															awc
+															{index}
+														/>
+													</div>
 												{/each}
 											</div>
 										</details>
-- 
cgit v1.2.3

